<?php

// Place in ./app/models/Entry.php

class Entry extends AppModel {
  var $name = "Entry";
	
	var $belongsTo = 'Feed';
	
	function setReadStatus($ids, $read = true) {
		if (!is_array($ids)) {
			$ids = array($ids);
		}
		
		foreach ($ids as $id) {
			$this->read(null, $id);
			$data = array(
				'Entry' => array(
					'id' => $id,
					'read' => $read ? 1 : 0
				)
			);
			$this->save($data);
		}
	}
												 
} // class Entry

?>